
#include"GlobalHeader.h"
#include"StdFIFO.h"
int main()
{
    FIFO *f_write = FIFOInit("./FIFO", WriteOnly);
    FIFO *f_read = FIFOInit("./FIFO2", ReadOnly);
    while(1)
    {
        char msg[100] = {0};
        printf("请输入你要发送的信息：");
        scanf("%s", msg);
        if(WriteFromFIFO(f_write,msg,100)==false)
        {
            ClearFIFO(f_read);
            ClearFIFO(f_write);
            return -1;
        }
        memset(msg, 0, 100);
        if(ReadFromFIFO(f_read,msg,100)==false)
        {
            ClearFIFO(f_read);
            ClearFIFO(f_write);
            return -1;
        }
        printf("接受来自管道的信息：%s\n", msg);
    }
    return 0;
}